import request from './request'

const baseUrl = "http://kumanxuan1.f3322.net:8360"


// 获取首页的detail内容
export const GetHomeDetail = (params) => request.get(`${baseUrl}/goods/category`, { params })

// 获取首页数据
export const GetHomeData = () => request.get(`${baseUrl}/index/index`)

// 获取popup窗口的初始数据
export const GetPopupData = () => request.get(`${baseUrl}/search/index`)

// 清除历史记录
export const ClearHistory = () => request.post(`${baseUrl}/search/clearhistory`)

// 请求下拉列表
export const GetDownListData = (params) => request.get(`${baseUrl}/search/helper`, { params })

// 搜索框搜索商品
export const GetSearchProduct = (params) => request.get(`${baseUrl}/goods/list`, { params })

// 获取专题搜索的数据
export const GetTopicList = (params) => request.get(`${baseUrl}/topic/list`, { params });

// 用户登录接口
export const GetUserLogin = (params) => request.post(`${baseUrl}/auth/loginByWeb`, params);

// 左侧分类数据
export const GetSiderData = (params) => request.get(`${baseUrl}/catalog/index`, { params })

//详情页数据
export const GetDetailData = (params) => request.get(`${baseUrl}/goods/detail`, { params })

// 大家都在看商品了数据
export const GetPeopleSeeData = (params) => request.get(`${baseUrl}/goods/related`, { params })

// 获取购物车数量
export const GetCartNumData = () => request.get(`${baseUrl}/cart/goodscount`)

// 获取购物车数据
export const GetShoppingData = () => request.get(`${baseUrl}/cart/index`)

// 删除购物车数据
export const GetDeleteShopping = (params) => request.post(`${baseUrl}/cart/delete`, params)

// 全选反选购物车
export const updateChecked = (params) => request.post(`${baseUrl}/cart/checked`, params)

// 编辑进步器
export const updateField = (params) => request.post(`${baseUrl}/cart/update`, params)

// 分类详情
export const cateDetailData = (params) => request.get(`${baseUrl}/goods/category`, { params })

// 加入购物车
export const addCartData = (params) => request.post(`${baseUrl}/cart/add`, params)

// 订单信息
export const orderSumibt = (params) => request.get(`${baseUrl}/api/cart/checkout`, { params })

// 获取收货地址列表
export const getAddressList = () => request.get(`${baseUrl}/address/list`)

// 获取省/市/
export const getaddress = (params) => request.get(`${baseUrl}/region/list`, params)

// 添加地址
export const addAddress = (params) => request.post(`${baseUrl}/address/save`, params)

// 删除地址
export const deleteAddress = (params) => request.post(`${baseUrl}/address/delete`, params)

// 提交订单接口
export const subimtPayOrder = (params) => request.post(`${baseUrl}/api/order/submit`, params)

// 订单支付接口
export const payOrder = (params) => request.get(`${baseUrl}/api/pay/prepay`, { params })




